﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test.DataAccess.POCO
{
    [Table("Role")]
    public partial class Role : BaseEntity
    {
        public Role()
        {
            Admins = new HashSet<Admin>();
            Permissions = new HashSet<Permission>();
        }

        [Required]
        [StringLength(50)]
        [DisplayName("角色名称")]
        public string RoleName { get; set; }

        [StringLength(200)]
        [DisplayName("角色描述")]
        public string Description { get; set; }

        [DisplayName("拥有此角色的管理员")]
        public virtual ICollection<Admin> Admins { get; set; }

        [DisplayName("角色拥有的权限")]
        public virtual ICollection<Permission> Permissions { get; set; }
    }
}
